#include <iostream>
#include <thread>
#include <unistd.h>

using namespace std;
int main() {
    std::cout << " this a test thread" << std::endl;

    auto fun = [](string s){
        for (int i = 0; i < 10; ++i) {
            cout << s << endl;
            sleep(1);
        }

    };

    thread t1(fun,"hello thread 1");
    thread t2(fun,"hello thread 2");

    t1.join();
    t2.join();
    return 0;
}